*{
    margin: 0;
    padding: 0;
}
body{
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #212121;
}
.container{
    /* 弹性布局 允许换行 水平居中 */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.card{
    width: 310px;
    height: 220px;
    overflow: hidden;
    margin: 10px;
    background-color: #000;
    color: #fff;
    cursor: pointer;
    position: relative;
}
.card img{
    width: 100%;
    height: 100%;
    /* 设置过渡 */
    transition: 0.35s;
}
.card .text{
    position: absolute;
    top: 30px;
    left: 30px;
    bottom: 30px;
    right: 30px;
    padding: 0 18px;
}
.card .text::before{
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: 100%;
    border-left: 4px solid rgba(255,255,255,0.8);
    background-color: rgba(255,255,255,0.5);
    opacity: 0;
    /* 过渡 */
    transition: 0.5s;
    /* 过渡延迟时间 */
    transition-delay: 0.6s;
}
.card .text h2,
.card .text p{
    margin-bottom: 6px;
    opacity: 0;
    transition: 0.35s;
}
.card .text h2{
    font-weight: 300;
    text-transform: uppercase;
    transform: translate(30%,0%);
    transition-delay: 0.3s;
}
.card .text h2 span{
    font-weight: 800;
}
.card .text p{
    font-weight: 200;
    transform: translate(0%,30%);
}
/* 悬停样式开始 */
.card:hover img{
    opacity: 0.3;
}
.card:hover .text h2{
    opacity: 1;
    transform: translate(0%,0%);
    transition-delay: 0.4s;
}
.card:hover .text p{
    opacity: 0.9;
    transform: translate(0%,0%);
    transition-delay: 0.6s;
}
.card:hover .text::before{
    background-color: rgba(255,255,255,0);
    left: 0;
    opacity: 1;
    transition-delay: 0s;
}